package shape;

import javax.media.opengl.GL2;

import util.Util;

import com.jogamp.opengl.util.gl2.GLUT;


public class Rectangle extends Shape {
	
	public Rectangle( double width, double height ) {
		super();
		setSize(width, height, 1.0 );
	}
	
	public Rectangle() {
		this(1.0, 1.0);
	}
	
	@Override
	protected void draw( GL2 gl ) {
		gl.glBegin(GL2.GL_QUADS);
		gl.glVertex3d(-1.0, -1.0, 0);
		gl.glVertex3d(1.0, -1.0, 0);
		gl.glVertex3d(1.0, 1.0, 0);
		gl.glVertex3d(-1.0, 1.0, 0);
		gl.glEnd();
	}
	
	@Override
	protected void drawSelected( GL2 gl ) {
		gl.glBegin(GL2.GL_LINE_LOOP);
		gl.glVertex3d(-1.0, -1.0, 0);
		gl.glVertex3d(1.0, -1.0, 0);
		gl.glVertex3d(1.0, 1.0, 0);
		gl.glVertex3d(-1.0, 1.0, 0);
		gl.glEnd();
	}

}
